package com.mxprojects.constructors
{
	import com.mxprojects.gui.Styles;
	
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	
	public class ButtonHighlight extends MovieClip
	{	
		private var eventListener:Function;
		
		public function ButtonHighlight(thingToHighlight:DisplayObject, clickEvent:Function, useButtonMode:Boolean = true){	
			Styles.setProperties(this, ".buttonHighlight");
			
			width = thingToHighlight.width;
			height = thingToHighlight.height;
			if(useButtonMode){
				buttonMode = true;
			}
			
			//set the event listener
			eventListener = clickEvent;
			
			//enable the hightlight
			enabled = true;
		}
		
		override public function set enabled(isEnabled:Boolean):void {
			//help this button out a lil bit
			ButtonHelper.handleMouseActions(this, isEnabled, eventListener);
		}		
	}
}